/////////////////////////////////////////////////////////////////////////
//
// Amuse Engine SDK - core/system/io/streams
// Copyright (c) 2014.  All Rights Reserved
//
// File:		AEDiskFileInStream.h
// Author:		Gianluca Belardelli
// Date:		08/10/2014
//
/////////////////////////////////////////////////////////////////////////
#ifndef _AEDISKFILEINSTREAM_H_
#define _AEDISKFILEINSTREAM_H_

class AEDiskFileInStream : public AEFileInStreamI
{
	friend class AEDiskFileSystem;
// Members
protected:
	AEUINT64	m_ui64FilePos;
	AEUINT64	m_ui64FileSize;

	char		*m_lpFileName;
	AEFileHandle m_fhFileHandle;

// Methods
protected:
	/// \brief 
	///   VDiskFileInStream instances are created by VDiskFileSystem.
	AEDiskFileInStream( AEFileHandle &fhHandle, AEFileSystemI *lpFileSystem = 0L);

public:
	void SetFileSystem( AEFileSystemI *lpFileSystem );

	///// Implement AEFileInStreamI

	virtual AEUINT32 Read( void *lpBuffer, AEINT32 nLen );
	virtual void Close( void );
	virtual AEBOOL32 SetPos( AEINT64 nPos, AEFileSeek eMode );
	virtual AEINT64 GetPos( void );
	virtual AEINT64 GetSize( void );
	virtual const char *GetFileName( void );

};

#endif // _AEDISKFILEINSTREAM_H_
